package com.seadragon.app.ksr.dao.jpa;

import java.util.List;

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;

import org.springframework.stereotype.Repository;

import com.seadragon.app.ksr.dao.StateLookUpDao;
import com.seadragon.app.ksr.model.tiger.StateLookUp;

@Repository("stateLookupDao")
public class StateLookUpDaoJpaImpl extends AbstractJpaDao implements StateLookUpDao {

	@Override
	public List<StateLookUp> findAll() {
		CriteriaBuilder builder = entityManager.getCriteriaBuilder();
		CriteriaQuery<StateLookUp> cq = builder.createQuery(StateLookUp.class);
		Root<StateLookUp> root = cq.from(StateLookUp.class);
		cq.select(root);

		return entityManager.createQuery(cq).getResultList();
	}
}
